* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f9;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.back-link {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    text-decoration: none;
    color: #007bff;
    font-weight: 600;
}

.back-link:hover {
    color: #0056b3;
}

.main-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.history-panel {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    align-self: start; /* Stick to top */
}

.history-panel h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

#historyList {
    list-style: none;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 15px;
}

#historyList li {
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden; /* To make text-overflow work on children */
}

#historyList li:hover {
    background-color: #f8f9fa;
}

#historyList li.active {
    background-color: #e9ecef;
    border-left-color: #007bff;
    font-weight: bold;
}

.history-method {
    font-weight: bold;
    margin-right: 8px;
    min-width: 45px;
    display: inline-block;
}
.history-method.GET { color: #28a745; }
.history-method.POST { color: #ffc107; }
.history-method.PUT { color: #17a2b8; }
.history-method.DELETE { color: #dc3545; }

.history-url {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#clearHistoryBtn {
    width: 100%;
    padding: 8px;
    border: 1px solid #dc3545;
    background: none;
    color: #dc3545;
    border-radius: 5px;
    cursor: pointer;
}

/* Request Panel */
.request-panel {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.url-bar {
    display: flex;
    margin-bottom: 20px;
}

#methodSelect {
    padding: 0 15px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 5px 0 0 5px;
    background-color: #f8f9fa;
    font-weight: bold;
}

#urlInput {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

#sendBtn {
    padding: 10px 25px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#sendBtn:hover {
    background-color: #0056b3;
}

/* Tabs */
.tabs, .response-tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}
.tab-link, .response-tab-link {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    color: #6c757d;
}
.tab-link.active, .response-tab-link.active {
    color: #007bff;
    font-weight: bold;
}
.tab-link.active::after, .response-tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #007bff;
}

/* Key-Value Pairs */
.key-value-pairs {
    display: grid;
    gap: 10px;
}
.kv-pair {
    display: flex;
    gap: 10px;
}
.kv-pair input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.kv-pair button {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    cursor: pointer;
    width: 36px;
}

.add-btn {
    margin-top: 15px;
    padding: 8px 15px;
    border: 1px dashed #007bff;
    background: none;
    color: #007bff;
    cursor: pointer;
    border-radius: 4px;
}

.body-type-selector {
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
}

.body-type-selector label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

#bodyTextarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

/* Response Panel */
.response-panel {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.response-meta span {
    margin-left: 20px;
}

.status-code.success { color: #28a745; }
.status-code.client-error { color: #ffc107; }
.status-code.server-error { color: #dc3545; }
.status-code.redirect { color: #17a2b8; }


#responseBody, #responseHeaders {
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#loadingIndicator {
    text-align: center;
    font-size: 2rem;
    color: #007bff;
    padding: 40px;
} 